<?php

namespace app\dev\controller;

use think\Controller;
use app\common\service\Adcard ;


class Card extends Controller{


    public function getImage(){
        $params = [
            [
                'type' => 'image',
                'value' => 'http://www.bookbag.com/uploads/20180822/8be2bb50ea2a8227ffc8be9ae049f3de.jpg',
                'width' => '590',
                'height' => '296',
                'left' => '40',
                'top' => '40',
                'border-radis' => 10,
            ],
            [
                'type' => 'image',
                'value' => 'http://www.bookbag.com/uploads/20180822/8be2bb50ea2a8227ffc8be9ae049f3de.jpg',
                'width' => '345',
                'height' => '236',
                'left' => '40',
                'top' => '377',
                'border-radis' => 0,
            ],
            [
                'type' => 'image',
                'value' => 'http://www.bookbag.com/uploads/20180822/8be2bb50ea2a8227ffc8be9ae049f3de.jpg',
                'width' => '200',
                'height' => '236',
                'left' => '425',
                'top' => '377',
                'border-radis' => 2,
            ],
            [
                'type' => 'text',
                'value' => '这是标题',
                'font-family' => 'SourceHanSans-Bold',
                'font-size' => 40,
                'left' => 40,
                'top' => '652',
                'color' => '#333333',
                'max'  => 30,
                'min'  => 2,
                'height'  => 60,
                'width'  => 590,
            ],
            [
                'type' => 'text',
                'value' => '这是内容，俺是到付哈速度删掉爱就输单号发就是打死的你发收款简单法看时间的发数据库的方式简单法你阿法速度快asd',
                'font-family' => 'SourceHanSans-Normal',
                'font-size' => 28,
                'left' => 40,
                'top' => 772,
                'color' => '#666',
                'max'  => 100,
                'min'  => 15,
                'height'  => 180,
                'width'  => 590,
            ],
        ];


        $res = Adcard::generateImage(Adcard::CUSTOM_CARD_SIZE, $params);


        var_dump($res);
    }


    public function test(){
      
        $list = \app\common\model\question\Qa::where([
            'user_id' => 21111,
            'qa_list_id' => INTREST_INT,
        ])->order('id desc')->value('answer_ids');

        var_dump($list);
        
    }
}